﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace Ex02
{
    /// <summary>
    /// Type Inferring
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            string[] names = { "Tom", "Dick", "Harry", "Mary", "Jay","Jhon" };

            names.Select(n => n.Length).Dump("Notice result is IEnumerable<Int32>; Int32 is inferred");

            IEnumerable<string> sortedByLength, sortedAlphabetically;

            names.OrderBy(n => n.Length).Dump("Integer sorting key");
            names.OrderBy(n => n).Dump("String sorting key");
            Console.ReadKey();
        }
    }
}
